package com.wza.designPattern.AdapterPattern;

/**
 * <一句话功能简述>
 * <功能详细描述>
 *
 * @author Administrator
 * @version [版本号, 2018/11/22]
 * @see [相关类/方法]
 * @since [产品/模块版本]
 */
public class AudioPlayer implements MediaPlayer
{
    MediaAdapter mediaAdapter;

    @Override
    public void play(String audioType, String fileName)
    {
        if ("mp3".equalsIgnoreCase(audioType))
        {
            System.out.println("Playing mp3 file. Name : " + fileName);
        }
        else if ("vlc".equalsIgnoreCase(audioType) || "mp4".equalsIgnoreCase(audioType))
        {
            this.mediaAdapter = new MediaAdapter(audioType);
            this.mediaAdapter.play(audioType, fileName);
        }
    }
}
